package server;

import java.util.ArrayList;
import java.util.List;

import common.CurrencyEnum;

public class BankAccount {
	private static long currentAccNumber = 0;
	private long accNumber;
	private String holderName;
	private String password;
	private CurrencyEnum currency;
	private float balance;

	public long getAccNumber() {
		return accNumber;
	}

	public String getHolderName() {
		return holderName;
	}

	public void setHolderName(String holderName) {
		this.holderName = holderName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public CurrencyEnum getCurrency() {
		return currency;
	}

	public void setCurrency(CurrencyEnum currency) {
		this.currency = currency;
	}

	public float getBalance() {
		return balance;
	}

	public void setBalance(float balance) {
		this.balance = balance;
	}

	public BankAccount() {
		this.accNumber = BankAccount.currentAccNumber++;
		System.out.println("current acc number " + BankAccount.currentAccNumber);
		this.balance = 0;
		this.holderName = "";
		this.currency = CurrencyEnum.SGD;
		this.password = "12345678";
	}

	public BankAccount(String holderName, String password, float balance,
			CurrencyEnum currency) {
		this.accNumber = BankAccount.currentAccNumber++;
		this.holderName = holderName;
		this.password = password;
		this.balance = balance;
		this.currency = currency;
	}
	
	public static List<BankAccount> PreLoadBankAccounts(){
		List<BankAccount> data = new ArrayList<BankAccount>();
		for (int i=0; i<10; i++) {
			BankAccount acc = new BankAccount("Holder ".concat(Integer.toString(i)),
					"12345678", 0, CurrencyEnum.SGD);
			}
		return data;
	}
}
